<?php
/* @var $this JokeContentController */
/* @var $data JokeContent */
?>

<li>
	<h2 style="float: left;">
		<?php echo $data->title; ?>
		<span><?php echo $data->user_id; ?></span>
	</h2>
    <div style="float: right;">
		<span class="label">Voturi:</span>
		<span id="n_<?php echo $data->id; ?>"><?php echo $data->grades_number; ?></span>
    </div>
	<p style="clear: both;">
		<?php echo nl2br($data->text); ?>
		<?php if( $data->user_id == Yii::app()->user->id ) { ?>
			<span>
				<?php echo CHtml::link('Modifică', 'update/'.$data->id, array('class' => 'more')); ?>
				<?php echo CHtml::link('Șterge', 'update/'.$data->id, array('class' => 'more')); ?>
			</span>
		<?php } else { ?>
		<span id="vot_<?php echo $data->id; ?>">
			<?php echo CHtml::link('Votează', 'vote/'.$data->id, array('class' => 'more')); ?>
		</span>
		<?php } ?>
	</p>
</li>